package org.abc.fund.repository.trade;

import org.abc.fund.entity.trade.Settlement;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SettlementRepository extends JpaRepository<Settlement, Long> {
  @Query("SELECT s FROM Settlement s WHERE s.tradeOrderDetail.tradeOrder.id = :tradeOrderId")
  List<Settlement> findByTradeOrderId(@Param("tradeOrderId") Long tradeOrderId);
}
